package com.situ.util;

import java.util.HashMap;
import java.util.Map;

public class ResponseData {

    private int code; //错误编码
    private String mess;//错误信息
    private Map data=new HashMap(); //你啊哟专递的值

    private static ResponseData my;

    public static ResponseData ok(){
        my=new ResponseData();
        my.code=200;
        my.mess="success"+my.code;
          return my;
    }
  //很多 的异常类型 自己去加....
    public static ResponseData error500(){
        my=new ResponseData();
        my.code=500;
        my.mess="内部错误"+my.code;
        return my;
    }

    public static ResponseData put(String key,Object value){
        my.data.put(key, value);
        return my;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMess() {
        return mess;
    }

    public void setMess(String mess) {
        this.mess = mess;
    }

    public Map getData() {
        return data;
    }

    public void setData(Map data) {
        this.data = data;
    }
}







